'use strict';

/**
 * @___Fj{color_line_log}{NB,HPW,Fundamentals,Closure-master }{NBase/_Md/_Index/_HPW/Part_I/content/Courses/Fundamentals/funcLambdConextClosure/Closure-master/JavaScript/5-logger.js}
 * @param kind
 * @returns {function(...[any]=)}
 */
const logger = kind => {
  const color = logger.colors[kind] || logger.colors.info;
  return s => {
    const date = new Date().toISOString();
    console.log(color + date + '\t' + s);
  };
};

logger.colors = {
  warning: '\x1b[1;33m',
  error: '\x1b[0;31m',
  info: '\x1b[1;37m'
};

// Usage

const warning = logger('warning');
const error = logger('error');
const debug = logger('debug');
const slow = logger('slow');

slow('I am slow logger');
warning('Hello');
error('World');
debug('Bye!');
